import cv2
import mediapipe as mp
camera=cv2.VideoCapture(0)
hand_detector=mp.solutions.hands.Hands()#获取手的信息
while 1:
    success,img=camera.read()
    if success:
        img_rgb=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)#颜色转换
        res=hand_detector.process(img_rgb)
        print(res.multi_hand_landmarks)
        cv2.imshow('Video',img)
    k=cv2.waitKey(1)
    if k==ord('q'):
        break
camera.release()#释放摄像头
cv2.destroyAllWindows()
